const db = require('../db/index')

exports.getInfo = (req,res)=>{
    const user = req.body
    console.log(user)
    db.query('select id, username, nickname,email, user_pic from ev_users where id=?',user.id,(err,result)=>{
        if(err){
            return res.send({
                status: 1,
                msg: '查询失败了'+err
            })
        }
        if(result.length!==1){
            return res.send({
                status: 1,
                msg: '获取失败了'
            })
        }
        return res.send({
            status: 0,
            msg: '查询成功',
            result: result
        })
    })
}